#ifndef CCQTCONTROLLERMANAGER_H
#define CCQTCONTROLLERMANAGER_H


#include "QtCore"
#include "QtGui"
#include "qtcoco/CocoHieriachy.h"
class AbstractPEditor :public QWidget
{
public:
    AbstractPEditor();
    AbstractPEditor(QWidget *parent);
	/* controllerName should be unique .                                                                     */
	AbstractPEditor(QString controllerName  );
	~AbstractPEditor();
    virtual QString regName()  = 0 ;
    virtual void checkNode(const QCocoNode &node) = 0 ;
	void init();
};

class CCQTControllerManager 
{

public :
	static CCQTControllerManager * sharedManager();

	QMap<QString , AbstractPEditor * > m_mapControllers;

	void reg(QString str , AbstractPEditor  *controller);	

	AbstractPEditor * findController(QString name);
	void unreg( QString param1, AbstractPEditor* editor );

};



#endif // CCQTCONTROLLERMANAGER_H
